/**
 * 
 */
package com.wilmar.process.entity.vo;

import java.util.Set;

import org.jbpm.api.ProcessInstance;

/**
 * @author MaKuBEX E-mail:makubexnet@gmail.com
 * @version 1.0.0 at Aug 4, 2009 10:27:49 AM
 * 
 */
public class ProcessInstanceVO extends AbstractValueObject implements
		ValueObject {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = 8346913384987655326L;

	private String id;
	private String name;
	private String key;
	private String state;
	private Set<String> activityNames;

	/**
	 * 完整构造函数，直接由一个流程实例对象转换而来
	 * 
	 * @param processInstance
	 *            流程实例
	 */
	public ProcessInstanceVO(ProcessInstance processInstance) {
		this.id = processInstance.getId();
		this.name = processInstance.getName();
		this.key = processInstance.getKey();
		this.state = processInstance.getState();
		this.activityNames = processInstance.findActiveActivityNames();

	}

	/**
	 * @return the activityNames
	 */
	public Set<String> getActivityNames() {
		return activityNames;
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @return the key
	 */
	public String getKey() {
		return key;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the state
	 */
	public String getState() {
		return state;
	}

	/**
	 * @param activityNames
	 *            the activityNames to set
	 */
	public void setActivityNames(Set<String> activityNames) {
		this.activityNames = activityNames;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @param key
	 *            the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @param state
	 *            the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}
}
